home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XA_6S.ZIP / SOURCE / DESKTOP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-27  |  1.1 KB  |  57 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include "K_DEFS.H"
  9. #include "XA_TYPES.H"
  10. #include "XA_DEFS.H"
  11. #include "XA_GLOBL.H"
  12. #include "OBJECTS.H"
  13. #include "DESKTOP.H"
  14.  
  15. /*
  16.     Desktop Handling Routines
  17. */
  18.  
  19. OBJECT *desktop=NULL;
  20.  
  21. /*
  22.     Set a new object tree for the desktop
  23. */
  24. void set_desktop(OBJECT *new_desktop)
  25. {
  26.     if (new_desktop)
  27.     {
  28. /* Size & position the desktop to fit the root window */
  29.         new_desktop->ob_x=root_window->wx;
  30.         new_desktop->ob_y=root_window->wy;
  31.         new_desktop->ob_width=root_window->ww;
  32.         new_desktop->ob_height=root_window->wh;
  33.     }
  34.     
  35. /* Set the desktop */
  36.     desktop=new_desktop;
  37.  
  38. /* Now use the root window's auto-redraw function to redraw it */
  39.     root_window->redraw=&redraw_desktop;
  40. }
  41.  
  42. /*
  43.     Redraw the desktop object tree
  44.     - blindingly simple or what?
  45. */
  46. short redraw_desktop(XA_WINDOW *wind)
  47. {
  48.     if (!desktop)
  49.         return FALSE;
  50.  
  51. /* We can ignore the wind parameter here, as the desktop window never actually moves
  52.    or changes dimensions */
  53.     draw_object_tree(desktop, 0, 100);
  54.  
  55.     return TRUE;
  56. }
  57.